package nanguo.not.cloud.service.impl;

import nanguo.not.cloud.dao.DeptRespority;
import nanguo.not.cloud.entity.Dept;
import nanguo.not.cloud.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;

/**
 * @Author: jing
 * @Date: 2019/3/28 13:53
 * @Version 1.0
 */
@Service
@Transactional(rollbackOn = Exception.class)
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptRespority respority;

    @Override
    public void save(Dept t) {
        respority.save(t);
    }

    @Override
    public void delete(Long id) {
        respority.deleteById(id);
    }

    @Override
    public Dept getInfo() {
        return respority.findAll().get(0);
    }
}
